// LastWorker.h: interface for the CLastWorker class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LASTWORKER_H__E645B3E3_80E7_4C27_BAE5_B1FDFE1698D4__INCLUDED_)
#define AFX_LASTWORKER_H__E645B3E3_80E7_4C27_BAE5_B1FDFE1698D4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

struct OFFSET_FROM_ORIGIN
{
	float xOffSet;
	float yOffSet;
};

#include "UserData.h"
#include "icr_8000.h"
#include "MyStringArray.h"

class CLastWorker  
{
public:
	IDENTIFY_INFO* GetCardIdentifyInfo(char* sideBuf);
public:
	void RotateOcrCell(_OCR_CELL *pCell, int theDirection);
	CStrings GetCardDescript(char* pBuffer,CStrings desName);
	FIELD_DEFINITIONS* GetOneField(char *sideBuf, int fieldID, int &fieldNum);
	void SetCard_WH(int width,int height);
	SCANNER_MODE* GetScannerMode(char* someBuf);
	char* GetSideAdr(char* someBuf,int sideFlag);
	bool RotateOneSide(char* sideBuf,int theDirection);
	CLIP_IN_DATA* GetImageClip(char* sideBuf);
	BARCODE_IN_DATA* GetBarCode(char* sideBuf);
	OCR_GROUP* GetOcrGroup(char* sideBuf,int groupID,int& groupNum);
	OMR_GROUP* GetOmrGroup(char* sideBuf,int groupID,int& groupNum);
	CHECK_DATA* GetOmrWhiteCheckLines(char *sideBuf, int lineID, int &lineNum);
	CHECK_DATA* GetOmrBlackCheckLines(char* sideBuf,int lineID,int& lineNum);
	CHECK_DATA* GetWhiteCheckLine(char* sideBuf);
	CHECK_DATA* GetBlackCheckLine(char* sideBuf);
	CLOCK_FORM* GetClockForm(char* sideBuf);

	CLastWorker();
	virtual ~CLastWorker();
private:
	DWORD g_tWidth,g_tHeight;
private:
	char* pFSideBuffer;
	DWORD lFSideLength;
	char* pBSideBuffer;
	DWORD lBSideLength;
	char* pTheBuffer;
	char* pTheTail;
	SCANNER_MODE ScannerMode;
private:
	void RotateOneCell(RECT_CELL* pCell,int theDirection);
	bool RotateImageClip(char* sideBuf,int theDirection);
	bool RotateBarCode(char* sideBuf,int theDirection);
	bool RotateOcrGroups(char* sideBuf, int theDirection);
	bool RotateOmrGroups(char* sideBuf,int theDirection);
	bool RotateCheckLines(char *sideBuf, int theDirection);
	bool RotateClockForm(char* sideBuf,int theDirection);
	bool RotateCardInfo(char* sideBuf,int theDirection);
};

#endif // !defined(AFX_LASTWORKER_H__E645B3E3_80E7_4C27_BAE5_B1FDFE1698D4__INCLUDED_)
